/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author roycalderon
 */
@Embeddable
public class BookPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "idBook")
    private int idBook;
    @Basic(optional = false)
    @NotNull
    @Column(name = "bookType_idbookType")
    private int bookTypeidbookType;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Editorial_idEditorial")
    private int editorialidEditorial;
    @Basic(optional = false)
    @NotNull
    @Column(name = "knowledgeArea_idknowledgeArea")
    private int knowledgeAreaidknowledgeArea;

    public BookPK() {
    }

    public BookPK(int idBook, int bookTypeidbookType, int editorialidEditorial, int knowledgeAreaidknowledgeArea) {
        this.idBook = idBook;
        this.bookTypeidbookType = bookTypeidbookType;
        this.editorialidEditorial = editorialidEditorial;
        this.knowledgeAreaidknowledgeArea = knowledgeAreaidknowledgeArea;
    }

    public int getIdBook() {
        return idBook;
    }

    public void setIdBook(int idBook) {
        this.idBook = idBook;
    }

    public int getBookTypeidbookType() {
        return bookTypeidbookType;
    }

    public void setBookTypeidbookType(int bookTypeidbookType) {
        this.bookTypeidbookType = bookTypeidbookType;
    }

    public int getEditorialidEditorial() {
        return editorialidEditorial;
    }

    public void setEditorialidEditorial(int editorialidEditorial) {
        this.editorialidEditorial = editorialidEditorial;
    }

    public int getKnowledgeAreaidknowledgeArea() {
        return knowledgeAreaidknowledgeArea;
    }

    public void setKnowledgeAreaidknowledgeArea(int knowledgeAreaidknowledgeArea) {
        this.knowledgeAreaidknowledgeArea = knowledgeAreaidknowledgeArea;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idBook;
        hash += (int) bookTypeidbookType;
        hash += (int) editorialidEditorial;
        hash += (int) knowledgeAreaidknowledgeArea;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BookPK)) {
            return false;
        }
        BookPK other = (BookPK) object;
        if (this.idBook != other.idBook) {
            return false;
        }
        if (this.bookTypeidbookType != other.bookTypeidbookType) {
            return false;
        }
        if (this.editorialidEditorial != other.editorialidEditorial) {
            return false;
        }
        if (this.knowledgeAreaidknowledgeArea != other.knowledgeAreaidknowledgeArea) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.BookPK[ idBook=" + idBook + ", bookTypeidbookType=" + bookTypeidbookType + ", editorialidEditorial=" + editorialidEditorial + ", knowledgeAreaidknowledgeArea=" + knowledgeAreaidknowledgeArea + " ]";
    }
    
}
